package com.bytime.permission.permissionmanage.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

import com.bytime.permission.action.common.EossCommFunc;

public class Popdom001Form extends ActionForm {
	private String roleNumber;
	private String roleName;
	private String description;
	private String caption;
	private String[] functionName;
	private String[] functionID;
	private String funListSelect;
	private String saveFlag;
	private String id;
	private String backFlag;
	private String addTitle;
	private String editTitle;
	private String returnFlag;
	private String returnURI;
	private String disableFlag;
	
	public ActionErrors validate(
		ActionMapping actionMapping,
		HttpServletRequest httpServletRequest) {
		ActionErrors errors = new ActionErrors();

		String str = httpServletRequest.getParameter("method");
		if (str.equals("init")) {
			return null;

		} else if (str.equals("save")) {
			if (!EossCommFunc.isAlphaNumber(this.roleNumber)) {
				errors.add(
					"roleNumber",
					new ActionError("error.popdom001.popdom1_1"));
			}
			if (!EossCommFunc.isMaxLength(this.roleNumber, 24)) {
				errors.add(
					"roleNumber",
					new ActionError("error.popdom001.popdom1_2"));
			}
			if (!EossCommFunc.isMaxLength(this.roleName, 56)) {
				errors.add(
					"roleName",
					new ActionError("error.popdom001.popdom1_3"));
			}
			if (!EossCommFunc.isMaxLength(this.description, 256)) {
				errors.add(
					"description",
					new ActionError("error.popdom001.popdom1_4"));
			}
			return errors;
		} else {
			return null;
		}

	}

	public void reset(
		ActionMapping actionMapping,
		HttpServletRequest httpServletRequest) {
	}

	public String getRoleNumber() {
		return roleNumber;
	}

	public void setRoleNumber(String roleNumber) {
		this.roleNumber = roleNumber;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getCaption() {
		return caption;
	}

	public void setCaption(String caption) {
		this.caption = caption;
	}

	public String[] getFunctionName() {
		return functionName;
	}

	public void setFunctionName(String[] functionName) {
		this.functionName = functionName;
	}

	public String[] getFunctionID() {
		return functionID;
	}

	public void setFunctionID(String[] functionID) {
		this.functionID = functionID;
	}

	public String getSaveFlag() {
		return saveFlag;
	}

	public void setSaveFlag(String saveFlag) {
		this.saveFlag = saveFlag;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getFunListSelect() {
		return funListSelect;
	}

	public void setFunListSelect(String funListSelect) {
		this.funListSelect = funListSelect;
	}
	/**
	 * @return
	 */
	public String getBackFlag() {
		return backFlag;
	}

	/**
	 * @param string
	 */
	public void setBackFlag(String string) {
		backFlag = string;
	}

	/**
	 * @return
	 */
	public String getAddTitle() {
		return addTitle;
	}

	/**
	 * @return
	 */
	public String getEditTitle() {
		return editTitle;
	}

	/**
	 * @param sring
	 */
	public void setAddTitle(String sring) {
		addTitle = sring;
	}

	/**
	 * @param string
	 */
	public void setEditTitle(String string) {
		editTitle = string;
	}

	/**
	 * @return
	 */
	public String getReturnFlag() {
		return returnFlag;
	}

	/**
	 * @param string
	 */
	public void setReturnFlag(String string) {
		returnFlag = string;
	}

	/**
	 * @return
	 */
	public String getReturnURI() {
		return returnURI;
	}

	/**
	 * @param string
	 */
	public void setReturnURI(String string) {
		returnURI = string;
	}

	

	/**
	 * @return
	 */
	public String getDisableFlag() {
		return disableFlag;
	}

	/**
	 * @param string
	 */
	public void setDisableFlag(String string) {
		disableFlag = string;
	}

}
